<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JSP page1</title>
</head>
<body>
	<h1>这是JSP页面1</h1>
	<!-- 以下是java代码 -->
	<%
		int i=1;
		int j = 2;
		int k = i+j;
		out.print(k);
	%>
	
	<br>
	<hr>
	<p style="color:#ff0000;font-size:24px"> 当前时间：
		<% java.util.Date now = new java.util.Date();%>
		<%= now.getHours() %>：
		<%= now.getMinutes() %>：
		<%= now.getSeconds() %>
	</p>
	
	<br>
	<hr>
	<!-- 使用java代码定义两个变量name和age -->
	<%!
		String name = "zhangsan";
		int age = 20;
	%>
	<!-- 使用java代码获取变量name和age的值并输出 -->
	<div>姓名：<span style="color:#0000ff"><%= name %></span> </div>
	<div>年龄：<%= age %> </div>
	
	<hr>
	<%
		String name1 = "zhangsan";
		int age1 = 20;
		out.print("姓名：<span style='color:#0000ff'>"+name1+"</span>");
		out.print("<br>");
		out.print("年龄："+age1);
	%>
	
	
	

</body>
</html>